import { func } from "prop-types";
import React, { useState, useContext } from "react";
import Son1 from "./component/son1";
import Son2 from "./component/son2";
// 3.给需要传值的组件导入进来
import { myContext } from "./context";
export default function App() {
    let [isShow, setShow] = useState(true)
    function isDisplay() {
        setShow(!isShow)
    }
    return (
        <div>aPP
            <Son1></Son1>
            <button onClick={isDisplay}>点击显示隐藏</button>
            {/* 4.用导入进来的作为组件给父组件包起来 */}
            <myContext.Provider value={isShow}>
                <Son2></Son2>
            </myContext.Provider>
        </div>
    )
}